
<?php 
	$key = (isset($_GET['key'])) ? $_GET['key']:'';
	$filter = (isset($_GET['filter'])) ? $_GET['filter']:'';
	$c = (isset($_GET['c'])) ? $_GET['c']:'';
?>
<form action="<?php echo site_url('admin/dataman/statistics/shows');?>" name="search" id="search" method="get" enctype="multipart/form-data" >
	Filter by Origin country
	<?php echo form_dropdown( 'c',
										$options = countryOriginDataConfig(),
										$selected = array($c),
										"id='c' onchange='return filterByCountry(this.value);'"
									); ?>
									
	<div id="search" >
		
		<?php echo form_label( "Search" ); ?>
		<?php echo form_input('key',$key,'maxlength="50" size="30"'); ?>
		
		<?php echo form_label( "Filter By" ); ?>
		<?php echo form_dropdown( 'filter',
										$options = array('buyer_email'=>'Buyer\'s Email','seller_email'=>'Seller\'s Email' , 'y'=>'Year'),
										$selected = array($filter),
										"id='filter' "
									); ?>
		<div class="clrboth"></div>

		<button style="margin-left:42px;" type="button" name="btnAction" value="Search" class="button" id="btnSearch" 
		onclick="this.form.submit();">Search</button>
	</div>
</form>	
<script type="text/javascript">
	function filterByCountry(value){
		window.document.location = BASE_URI+'admin/dataman/statistics/shows/?c='+value;
	}
</script>